import Taro from '@tarojs/taro'
import {View} from '@tarojs/components'
import {AtTabs, AtTabsPane} from 'taro-ui'
import './topTabs.less'

export default class TopTabs extends Taro.Component {
  constructor() {
    super(...arguments)
    this.state = {
      current: 0,
    }
  }

  handleClick(value) {
    this.setState({
      current: value
    })
  }

  render() {
    const tabList = [{title: '推荐'}]
    return (
      <AtTabs className='tabs-container' current={this.state.current} tabList={tabList} onClick={this.handleClick.bind(this)}>
        <AtTabsPane current={this.state.current} index={0}>
          <View style='padding: 500PX 50PX;background-color: #FAFBFC;text-align: center;'>推荐的内容</View>
        </AtTabsPane>
      </AtTabs>
    )
  }
}
